From: Florian Müllner Date: Wed, 22 May 2013 14:42:00 +0000 (+0200) Subject: screencast: Fix return value in case of invalid file template X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=374aee75d8055c2a0763b6dbb1adf822c1ca3ef5;p=gnome-shell.git screencast: Fix return value in case of invalid file template If we are passed an invalid file template, ShellRecorder.record() will return a %NULL filename; as the Screencast DBus interface expects a string return value, we cannot return the value unmodified in that case. https://bugzilla.gnome.org/show_bug.cgi?id=700842 --- diff --git a/js/ui/screencast.js b/js/ui/screencast.js index 642d40ac6..4a14933cc 100644 --- a/js/ui/screencast.js +++ b/js/ui/screencast.js @@ -105,7 +105,8 @@ const ScreencastService = new Lang.Class({ recorder.set_file_template(fileTemplate); this._applyOptionalParameters(recorder, options); - returnValue = recorder.record(); + let [success, fileName] = recorder.record(); + returnValue = [success, fileName ? fileName : '']; } invocation.return_value(GLib.Variant.new('(bs)', returnValue)); @@ -125,7 +126,8 @@ const ScreencastService = new Lang.Class({ recorder.set_file_template(fileTemplate); recorder.set_area(x, y, width, height); this._applyOptionalParameters(recorder, options); - returnValue = recorder.record(); + let [success, fileName] = recorder.record(); + returnValue = [success, fileName ? fileName : '']; } invocation.return_value(GLib.Variant.new('(bs)', returnValue));